[SPARK-46615][CONNECT] Support s.c.immutable.ArraySeq in ArrowDeserializers#44618
Closed
panbingkun wants to merge 4 commits intoapache:masterfrom
Closed
[SPARK-46615][CONNECT] Support s.c.immutable.ArraySeq in ArrowDeserializers#44618panbingkun wants to merge 4 commits intoapache:masterfrom
panbingkun wants to merge 4 commits intoapache:masterfrom
Conversation
panbingkun
commented
Jan 8, 2024
|
|
||
| val myUdf2 = udf((a: immutable.ArraySeq[Int]) => | ||
| immutable.ArraySeq.unsafeWrapArray[Int](a.appended(5).appended(6).toArray)) | ||
| immutable.ArraySeq.unsafeWrapArray[Int]((a :+ 5 :+ 6).toArray)) |
Contributor
Author
There was a problem hiding this comment.
Only fix the comment related issues of another PR: #44591
Contributor
There was a problem hiding this comment.
Could we move this change to a separate pr
LuciferYang
reviewed
Jan 8, 2024
| testImplicit(booleans) | ||
| testImplicit(booleans.toSeq) | ||
| testImplicit(booleans.toSeq)(newBooleanSeqEncoder) | ||
| testImplicit(immutable.ArraySeq.unsafeWrapArray(booleans)) |
Contributor
There was a problem hiding this comment.
we can just
import org.apache.spark.util.ArrayImplicits._
at the file header, and then
testImplicit(booleans.toImmutableArraySeq)
testImplicit(shorts.toImmutableArraySeq)
...
| mutable.ArraySeq.make(array.asInstanceOf[Array[T]]) | ||
| } | ||
|
|
||
| def toImmutableArraySeq[T](array: AnyRef): immutable.ArraySeq[T] = { |
Contributor
There was a problem hiding this comment.
nit: Perhaps we can directly use the implicit conversion defined in ArrayImplicits instead of add this new function, which is now a more generic conversion way in Spark code.
|
|
||
| val myUdf2 = udf((a: immutable.ArraySeq[Int]) => | ||
| immutable.ArraySeq.unsafeWrapArray[Int](a.appended(5).appended(6).toArray)) | ||
| immutable.ArraySeq.unsafeWrapArray[Int]((a :+ 5 :+ 6).toArray)) |
srowen
approved these changes
Jan 30, 2024
LuciferYang
approved these changes
Feb 8, 2024
Contributor
|
Merged into master for Spark 4.0. Thanks @panbingkun @srowen |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
The pr aims to support s.c.immutable.ArraySeq as customCollectionCls in ArrowDeserializers.
Why are the changes needed?
Because s.c.immutable.ArraySeq is a commonly used type in Scala 2.13, we should support it.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Update existed UT (SQLImplicitsTestSuite).
Was this patch authored or co-authored using generative AI tooling?
No.